package com.itheima.job4;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {

        //创建serverSocket对象并设置端口号
        ServerSocket server = new ServerSocket(6666);
        while(true){
            Socket socket = server.accept();//获取与服务端连接的socket

            new Thread( new ServerThread(socket)).start();
        }
    }
}
